<?php
  class Model_content extends CI_Model{
	  protected $_table = "tbl_content";
	  protected $_category = "tbl_category";
	  public function __construct(){
		  parent::__construct();
		  $this->load->database();
	  }
	  public function listcate(){
		  $this->db->order_by("category_order","asc");
		  return $this->db->get($this->_category)->result_array();
	  }
	  public function getarticels($id){
		  $this->db->where("cate_id",$id);
		  return $this->db->get($this->_table)->result_array();
	  }
	  public function getdataone(){
		  $this->db->where("con_id",1);
		  return $this->db->get($this->_table)->row_array();
	  }
	  public function getdata($id){
		  $this->db->where("con_rewrite",$id);
		  return $this->db->get($this->_table)->row_array();
	  }
  }